More OO and code improvements