directory can be null; delete filename_size & random_filename()
remove duplicated param passing from child's method to parent's method