refactors, change class => case class