Prototype for build function
Build prototype
Refactor build method.