fixed warning in shared specs + minor refactoring