Restructured code preparing it for future changes