Revert "Bug #2005, cleaner more better code"

This reverts commit 0cbf13b121a7f0c2b1400da048d34d906b01ac44.
Revert "Revert "Bug #2005, cleaner more better code""

This reverts commit 984d443000ef06e3ec0f2a368f726de053b039b7.
Revert "Revert "Revert "Bug #2005, cleaner more better code"""

This reverts commit 41a8f701cb17b051c470b0286cf238fe243e13c1.
fix file from last f'd up commit