refactoring status.rb