Set up infrastructure to remove some code duplication