Code cleanup and moving towards a more Ruby-esque style