move app.rb file to lib directory