Removed redundant call to getComponents(). Moved logic to add additional attributes from getComponents() to build() so that the components are only looped over once.