i feel like this code could be factored to be more readable and more concise. also i want it to have open hooks for my categoryAxis to plug into