29249 move common logic to toolbox

@tsanko @hippee-lee @kevinsproles @texasag here is the Texas-big PR for moving the logic from the theme to toolbox common. There is a similar PR in the method theme repo too.