separation into three modules: model, serialization, convenience functions for html