refactor to multiple classes