Fix compilation from IDEA and remove deprecation