refactoring user_spec and app