Cleaner code for montage