Removed unnecessary code duplication