Cleaned up code ready for v 0.2