refactored constPool function to be concise