refactor building