refactor: almost finished