Refactoring and attempting to prepare first tests