Added more code before taking out methods in the constructor.