refactor a bunch of code inside of Shell class.
Fix method calls by reflection