API refactoring and new test cases, splitting into separate model and view component files