add user tests and some refactors