Rework types into separate modules