tests passing after component loading function split into new class