revamp structure, add coverage and codestule