updated user and refactored the main store