refactor cruft