Made return logic more concise