More tidying
Refactor resource
Tests pass