refactor to separate handlers and controllers