cast computed way in a proper way, add a static assertion to check for file types via traits