Moved logic from process to initialize