Implemented namespace detection