refactoring: switch to model/view pattern, update utils