Moved all functions into a class
Moved all functions into a class