refactor drawing