make buildClasses more smarter