tools for dialyzer
start to specify types
refactor out a bunch of the controller functions into 2 new modules