Some cleanup
Add some new functionality