remove some useless lock
move count as public api