clean up more code duplication