move messy definitions

into their own module