break some code out to separate units