Tidied js code snippet for conversion forms