breaking up createProfile into separate functions