some code style refactor; change hash style to ruby 1.9