refatoring get movie function