slight improvement to profile controller logic