refactor scalamodules, beginning of HAS api