Fix deprecated parts of code

deprecated methods should not use anymore