more oop-like code simplification