Refactor stocks module