Clean up, added tests