smart switch formatting stuff