Bdog refactor

refactored app.rb with helper methods