Add refactor class detection, fix abstract problem