modify to sub modules and bare script for entities