refresh counter seconds calculation refactored, some illogical behaviour fixed