refactoring, fixes for go1.2, modify added