Pr/51

This is a cleanup and merge of @esoergel's pull-request