=pro #15031 move build logic into separate files