fix coding style : wrong indentation
refactor, simplify code