Refactoring to allow even more flexibility