cleaned up the implementation for tracking.