refactor everything with more support from type system.