Refactor code
Add counter feature