some more refactor