mantis 3756 plus cleaning-up/refactoring