refactor badly named functions