Refactor pigeon code in style of programming_languages code