Refactor chart builder for better customization