merge refactor from lokaltog