implement conditional loading