Refactor modules and view models