Convertng hack into a proper plugin.