Move layer rendering into its own class