Refactored and 100% test covered