Trying to fix issue #297
Code refactor
Fixed?