refactoring arguments parsing to own function
slight refactoring cleanup of callFunction
refactoring to using own callback handler instead of the Q node resolver