Added template slot generation functionality and tests