beautify first and last pages