finished handler refactor