[REFACTOR] Clean up templates in type compiling and add bootstrap code for properties