Use try-with-resources for playing

Plus some minor stylistic changes