Simplifying slide code