Small refactoring
Cleanup
Add simple test
Small fix