updated energy framework to be openned to different channels, close #1756
added provision against NPE