added required objects hook and did some file cleanup