Refactored the structure to make it slightly simpler to consume and understand