Refactored until last basic exercise