REVIEW-1157 Tidy up in the build configuring logic that deals with configuration on demand mode and with regular mode. Simplified the implementation.