refactorings on build flow