a small attempt to make the code ruby style