Adapting code to composer deprecated methods