refactored tests and views