Changed register functions to take user object