Reduced duplicated code.