+ Created template method pattern and refactored some parts of code