TRUNK-4245: Method uses the same code for two branches