new file, some refactor