Refactor location, filename, and klabel attributes

**please review**
ok