Codechanges and optimations inside modify.php