Custom select: Simplified the code a bit