Restructured code for better encapsulation | Changed version template