Split out the handlers into their own module and added extra checks in the handle method