refactored, moved non express logic into separate file