Refatored the method to handle the stock