Removing duplicate code.