refined code for user dao