various refactor