clean up and clarify build method