pulling out profile code to central place