Changed class functions to static and refactored some code