Removing duplicated code.