add badge model; refactor
fix memory leak