Some code refactoring.
Some code refactoring.

jesjimher/emoncms,jeremypoulter/emoncms,JFPayeur/emoncms,saydulk/emoncms,chaveiro/emoncms,sittipol123/emoncms,emoncms/emoncms,thaipowertech/emoncms,thaipowertech/emoncms,saydulk/emoncms,sittipol123/emoncms,emoncms/emoncms,nmgeek/emoncms,emoncms/emoncms,chaveiro/emoncms,saydulk/emoncms,jeremypoulter/emoncms,inverse/emoncms,emoncms/emoncms,inverse/emoncms,thaipowertech/emoncms,vinipletsch/emoncms,JFPayeur/emoncms,jesjimher/emoncms,jeremypoulter/emoncms,sittipol123/emoncms,0ddie/emoncms,chaveiro/emoncms,inverse/emoncms,0ddie/emoncms,arjenhiemstra/emoncms,thaipowertech/emoncms,emoncms/emoncms,nmgeek/emoncms,euqip/emoncmsbase,euqip/emoncmsbase,euqip/emoncms,0ddie/emoncms,jesjimher/emoncms,euqip/emoncms,euqip/emoncms,arjenhiemstra/emoncms,euqip/emoncmsbase,euqip/emoncms,jesjimher/emoncms,vinipletsch/emoncms,arjenhiemstra/emoncms,vinipletsch/emoncms,JFPayeur/emoncms,jeremypoulter/emoncms,nmgeek/emoncms,JFPayeur/emoncms,0ddie/emoncms,inverse/emoncms,chaveiro/emoncms