cleaned up rogue and template code