Parse template refactor