Refactor #4365: Refactor layers and sprite constructors with init functionality