Cleaned up template a bit