The code is ugly