Refactoring, various updates.