polishing ruby scripts