implement countdown and also refactor some methods