Fix #19
Refactoring