Removed code duplication