Improve get-class-name

Asked Bronsa on IRC how to do this and he was kind enough to help me out :)