Fix #117 and refactor for coding style