more OOP changes and optimisations