refactor component builder