fix version
refactoring code and fixing style