fix logging
fix
fix
fix
fix
fix
fix
refactor
fix
Merge pull request #3 from coldnight/refactor

Refactor