fixing spec warnings

code cleanup to get rid of deprecation warnings