remove supperfulous code and add defaults and requiered properties