Refactor location class