add RSET command and more refactoring