improved rubyish method and var parsing.