Moved my class to a different file and include it. Also refactored code