added tests, updated validation and loader