Beginning some refactoring.