updates

added registration state in the registerTerminal.
code cleanup
update

updated form log and added external log for periodic updates