Moved setup out of core