move profile code arround whole script