Moved logic from process to init block