only two years after muhammad 's arrival in what was now medina , the core community of muslims started to expand , and in medina , in addition to preaching the religious and moral message of islam , muhammad also took to organizing an islamic society ( based on his revelations ) and appointed himself head of state , diplomat , military leader , and chief legislator for the now the growing muslim community .