Clean up cyclic complexity in loadmodel decorator