Various refactoring...