consolidate more common functionality into common.js