refactored bob.js to remove if else crapola