convert tabs to spaces
make interface checks first, as they have lowest priority
cleanup and rename, add tests