Added Id and cleaned up some code