Handler updates
Update to use switch statement and to handle errors nicer