extract inline class to simplify reading the code
extract submethods to simplify code
simplify code in BuilderHelper
simplify code