refactor & format