attempt at refactoring configure