You may feel compelled to do something extremely general to achieve some goal, but have you considered to try and take the less generalizable approach and just handle every case individually? Sometimes this is [[what what makes something bad|easier than you think]]