Refactor handlers