I would check flag lib for better solution later.