Feature/closure based accessors

Fix for #2