allocation of duplicate code in external method