Some more cleanup and added a new test for resource definition