Refactoring code tree specs

This pull request contains small improvements on code tree specs