preliminary schema and some cleanup