Clean up ignore files
Moved common element creation checks into helper function