removing overhead code and simplifying the flow

refactored some parts

added new console commands