refatored the local user controller