Move some code to CompCore