base grey var added and appropriate refactoring done