refactoring my ruby a little, to look for areas that could be converted to functions, improved, or otherwise made reusable