fix app crash and use formatter through di
Add refactor
add formatter on web side
fix unit test
remove commented code