flatten enum task --> there is quite of code duplication