Huge changes to resolve all the issues