Bug #2005, cleaner more better code