New train path element add implemented

Also code have been refactored with auto-refactor