refactor and stuff