Refactor code :smiley:

Measures functionality has been drasticaly refactored. Each measure type has been extracted out into a different method.