refactoring of status.rb