Refactored to allow different flavours