Refactor location, filename, and klabel attributes

**do not review yet**