clean up code to better fit with Ruby conventions