Restructured code with an oop style