Refactoring to meet coding style check by flake8
Refactoring by adding readOption function