refactoring circle drawing