code refactoring ejb security