Refactor timeline position setting