updating gems and cleaning up code