put Layer class into separate file