Add dimension support & some cleanup