Refactors specs and removes deprecation warning