Code formatting, consolidate return logic