refactor making title and output name