Refactoring most of analytic models