Reworked code