modify edittext layout, and refactor location code