extract location introduced
merged some local changes with extract location method