moved all initialization to the constructor