finish extracting models and some cleanup