simplified, refactored handler, cleanup