refactering and cleaning thigs up