Added specs for common defs and minor refactor