Refactor stocktrade