Move code from root.rb and deleted it