Refactor throughout based on feedback from Dylan.