refactor modules/handlers