Remove nested class and inheritance