refactor: major improvements