Refactoring: Started to move code from gen_server callback functions.
Moved timeout handling code out from gen_server callback.
Made time an argument to the timeout function.