refactorised the tracker in a class