Enhance the version extraction method

Signed-off-by: Tomas Hozza <thozza@redhat.com>