move tests of build members to build() function