Implement better solution for preview editor