removed swap and excess in template