Trimmed & swapped code for faster performance