and modified the rest of my algorithm declaring standalone functions instead, called then in the loop()
It doesn't matter how much code you take out of loop() and put into functions called from loop(), if there is blocking code in the functions then the operation of loop() will be affected.
Did you refactor your code to remove blocking when you put it into functions ?