code cleanup in templating, added edit section in profile