refactor and other stuff