Refine coding style and logic and add .coveragerc .editorconfig