some cool refacturing, thinking about structure