modularizing a bit the charts