reorganized file to match ruby idioms