simpler implementation in timer class