Further updates, refactoring