Last commit of the daya, code cleanup and fixes