Centralize layer filter

As mentioned in #375, this centralises the current layer filter in order to be used elsewhere in the application.

Note: this PR depends on #375 to be merged first.