finishes profile updating

also some minor code cleanup