reorganize code and create methods to be used by cheatoid trade method