Some minor refactor