Extracted shared transition code to private method
Added top and bottom flip transitions