Removed code repetition