Simplified into several smaller methods
Merge pull request #3 from RhysStansfield/master

Simplified into several smaller methods