remove undocumented code and uncessary in_array() checks + cleanup
Merge pull request #1493 from dereuromark/2.4-cleanup

remove undocumented code and unnecessary in_array() checks + cleanup