implemented closeable, slight tidy