Refactoring to make the code a bit neater.
Merge branch 'master' of https://github.com/S73417H/p2