Added externalised db properties and handle key location