Refactored the initialization part of the tracking