moved two functions to different position in source file