Removing duplication code.