Improved architecture

moved helper functions to their own file, changed phrases to functions.