v1.1 code refactor