use handler to replace countdowntimer and use enum to replace some static final variable