some refactor in stock services