Refactor create select