make methods private
refactor state struct to map
add hgetall api