ETC: refactor total codes, layouts