Current refactor progress. Many things not finished...