refactor just a bit