Removed unused codes and improved naming conversion for variables