Sinatra/Rails helpers refactoring