Eliminated duplicate code.