few ruby improvments