merged changes and improvements from octris framework