Refactor location, filename, and klabel attributes

**please review**
a bit hackish, we could leave the implementation for clients