Major refactoring almost finished...