Re-write method for string format, fix imports