refactor into multiple classes #3 #6