cleaned up getProfile method