Initial commit extracted from the chooie project