Reverse Engineering Encapsulated Components From Legacy Code