refactor & seperation