refactor & clean up