Follow up changes as pointed out in #32
Cleaning up resources #31