Refactor format_select method to Module for reuse for stock details