everything working, begin to refactor