added logic to handle not used and overriden selectors and declarations