remove unwanted spaces, format population key/value