refactoring stocks