refactor everything