Some minor updates and template system