Return handler object rather than instance, and clean up tests