Move oneclick handlers to external file