removed unused code and used Refs in child class