try to factor out some functionality