tsdb loader refactoring