Cleaned up some code for template version, removed some extra logging