Clean and document layer.h file