Removes duplicate code