first pass at rafactoring to handlers
performance improvements for initialization #65
tests for handlers #65