Refactor

Did some refactoring to remove hashes when calculating revenue. Unit tests are green :green_heart: