moved around internal helper fxns