Refactor stock model