Created class and turned functions into handlers.