refactor and various