Fixes #98

Fixes issues & Code refactoring