Tesla refactor