Replace duplicate code with common function call.