improved test coverage and added view tests