Improve detected class relations