refactor (but names are still terrible)