some syntax changes to better support ruby 1.8