everything working, time to refactor