Moved build method code to constructor