refactor for build