Simpifying code