calculate stats properly
add l20n format support
refactor some code, make compare sync