add . as operator; refactor apply