Draft 2 based on mean template code