Add previews generation functions. Need to test it.