A lot of cleanup and changes + new iterface