Moved the class functions into the class itself