move out model/collection code