Extend Closeable instead of AutoCloseable.
Unwind nested if statements.