Restructured code in a class