consolidation of code
added todo