appl class added.
changed daemon class to singelton design
function define_args added.