#12 complete refactor