refactor misc