Updated to use capabilities instead of deprecated methods