some internal refactoring and cleanup. external api is the same