Moved fragment code into fragment file